<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var rs = 3 > 2 ? "abc" : "124";
      console.log(rs);

      var bool = [] ? true : false; //[]为true
      console.log(bool);

      var str = "";
      var rs = str.length ? true : false;
      console.log(rs);

      var str = "";
      var rs = str.length ? "abc" : 2 > 3 ? 2 : 3; // 3 可以嵌套
      console.log(rs);
    </script>
  </body>
</html>
